package xhwl.insurance.db.bean;


import java.util.Collection;
import java.util.HashMap;

import xhwl.android.common.util.SPUtil;

/**
* 数据库表定义
* @author lim
* @date 2017年2月9日
* @version 1.0
*/
public class SaleInfo {
    public enum Status{FAIL,SUCCESS}
    public int id;
    public String person_name;
    public String person_mobile;
    public String id_card_number;
    public String card_name;
    public String card_number;
    public String card_price;//暂存，不用
    public String sale_type;
    public String c_type;
    public String yw_id;
    public String member_id;//区分不同登录用户
    public String saler_mobile;//销售人手机号
    public String saler_user_id;//销售人id

    public int status=Status.FAIL.ordinal();//0失败1成功
    public long create_time;
    public long update_time;

    public HashMap<Integer,SalePicInfo> picInfoMap=new HashMap<>();
    public SaleInfo(){
        this.member_id= SPUtil.getPersonInfoSp().getString(SPUtil.SPPersonInfo.MEMBER_ID,"");
    }
    @Override
    public String toString() {
        Collection<SalePicInfo> values = picInfoMap.values();
        String picinfo="--";
        for(SalePicInfo info:values){
            picinfo+=info.toString();
        }
        return "SaleInfo{" +
                "id=" + id +
                ", member_id='" + member_id + '\'' +
                ", saler_mobile='" + saler_mobile + '\'' +
                ", saler_user_id='" + saler_user_id + '\'' +
                ", person_name='" + person_name + '\'' +
                ", person_mobile='" + person_mobile + '\'' +
                ", id_card_number='" + id_card_number + '\'' +
                ", card_name='" + card_name + '\'' +
                ", card_number='" + card_number + '\'' +
                ", card_price='" + card_price + '\'' +
                ", sale_type='" + sale_type + '\'' +
                ", c_type='" + c_type + '\'' +
                ", yw_id='" + yw_id + '\'' +

                ", status=" + status +
                ", create_time=" + create_time +
                ", update_time=" + update_time +
                ", picInfoMap:size" + picInfoMap.size() +
                ","+picinfo+"}";
    }
}
